package com.killer.goods.feign;


import com.killer.common.entity.PageResult;
import com.killer.common.entity.Result;
import com.killer.goods.entity.Goods;
import com.killer.goods.entity.Spu;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 标准产品单位表 前端控制器
 * </p>
 *
 * @author killer
 * @since 2021-08-29
 */
@FeignClient("shop-goods-service")
@RequestMapping("/spu")
public interface SpuClient {

    @PostMapping("/addGoods")
    public Result addGoods(@RequestBody Goods goods);

    @GetMapping("/findGoodsById")
    public Result<Goods> findGoodsById(@RequestParam Long id);

    @PostMapping("/updateGoods")
    public Result updateGoods(@RequestBody Goods goods);

    @PostMapping("/audit")
    public Result autit(@RequestParam("id") Long id);

    @PostMapping("/pull")
    public Result pull(@RequestParam("id") Long id);

    @PostMapping("/put")
    public Result put(@RequestParam("id") Long id);

    @PostMapping("/add")
    public Result add(@RequestBody Spu t);

    @PostMapping("/update")
    public Result update(@RequestBody Spu t);

    @PostMapping("/delete")
    public Result delete(@RequestParam Long id);

    @GetMapping("/findById")
    public Result<Spu> findById(@RequestParam Long id);

    @GetMapping("/search")
    public Result<List<Spu>> search(@RequestParam Map<String, Object> searchMap) ;

    @GetMapping("/findPage/{pageNum}/{pageSize}")
    public Result<PageResult<Spu>> findPage(@RequestParam Map<String, Object> searchMap,
                                            @PathVariable("pageNum")Integer pageNum,
                                            @PathVariable("pageSize")Integer pageSize);

    @GetMapping("/batchGetMarketableSpu")
    public Result<List<Spu>> batchGetMarketableSpu(@RequestParam Long startId) ;
}
